<?php
require_once APPLICATION_PATH . "/models/ModelBase.php";

class Users extends TT_Table_Abstract
{
    protected $_name = 'users';
	protected $_primary = 'uid';
	
	//Ham truy cap vao csdl, kiem tra username va password co ton tai trong csdl khong
	//tra ve object user neu cap username-password do ton tai
	//nguoc lai, tra ve null
	public function checkUser($username, $password)
	{
		$db = $this->getSessionDB();
		$sql = 'SELECT * FROM users WHERE name=? AND pass=?';
		return $db->fetchRow($sql, array($username,$password));		
	}
    
}
